<template>
	<view class="myshenginqg">
		
		<view class="content" v-if="list.name">
			<view class="gg">
				<view class="center">
					<view class="mm">
						<view class="name">
							用户名:{{list.name}}
						</view>
						<view class="student_card">
							手机号:{{list.student_card}}
						</view>
					</view>
					
				</view>
				<view class="left">
					<image class="img" :src="list.pay_card" mode=""></image>
<!-- 					<image class="img" :src="list.student_image" mode=""></image> -->
				</view>
			</view>
			
			<view class="right">
				<view class="h">
					<uni-tag v-if="list.is_apply === '2'" text="不通过" type="error" :circle="true"></uni-tag>
					<uni-tag v-else-if="list.is_apply === '-1'" text="您已被封号" type="error" :circle="true"></uni-tag>
					<uni-tag v-else-if="list.is_apply === '1'" text="通过" type="success" :circle="true"></uni-tag>
					<uni-tag v-else-if="list.is_apply === '3'" text="审核中" type="primary" :circle="true"></uni-tag>
					<uni-tag v-else text="审核中" type="primary" :circle="true"></uni-tag>
				</view>	
				<view class="error_" v-if="list.is_apply === '2'">
					{{list.error_curse}}
				</view>
				<button class="editbtn" v-if="list.is_apply !== '1' && list.is_apply !== '-1'" @click="gotoedit" is-link type="default" size="mini">编辑申请</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				list: []    // 用户接单信息表
			}
		},
		methods: {
			/*
						前去编辑
					*/
			gotoedit () {
					   uni.navigateTo({
					   	url: '../userOrderApply/userOrderApply?obj=' + encodeURIComponent(JSON.stringify(this.list))
					   })
			},
			// 判断是否是商家
			judgeIsBusiness () {
				if (this.list.name) return 
				uni.showModal({
					title: '提示',
					content: '检测到您还没有成为骑士，您是否前往申请?',
					success(e) {
						if (e.confirm) {
							uni.navigateTo({
								url: '../userOrderApply/userOrderApply'
							})
						}
					}
				})
			}
		},
		async onShow() {
			const {data: res} = await uni.$http.get('/apply/getuserapply')
			if (res.status　!== 0) return uni.showToast({
				title: '获取我的申请信息失败',
				icon: 'none'
			})
			this.list = res.data
			this.judgeIsBusiness()
		}
		
	}
</script>

<style lang="scss" scoped>
	.end_img {
		width: 80px;
		height: 80px;
	}
	.content {
		position: relative;
		padding: 5px;
		margin-top: 10px;
		border-radius: 5px;
		box-shadow: 1px 1px 1px #FFF7CC;
		background-color: #FFFFFF;
		margin: 5px;
		border: 1px solid #4cd964;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.left {
			margin-top: 5px;
			margin-bottom: 5px;
			.img {
				margin-right: 15px;
				width: 80px;
				height:	80px;
			}
		}
		
		.center {
			margin-top: 5px;
			
			.mm {
				color: #000000;
				font-size: 12px;
			}
			.name {
				
			}
			.student_card {
				
			}
		}
		.right {
			
			.h {
				
			}
			.b {
				
				.btn {
					
				}
			}
		}
	}
	.error_ {
		margin-top: 5px;
		color: #C00000;
		font-size: 12px;
	}
	.editbtn {
		position: absolute;
		    display: flex;
		    align-items: center;
		    justify-content: center;
		    width: 90px;
		    height: 30px;
		right: 5px;
		bottom: 10px;
		font-size: 12px;
		color: #FFFFFF;
		background-color: #07C160;
	}
	.none {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 10px;
		font-size: 12px;
		color: #000000;
		text-align: center;
	}
</style>

